package com.example.demo.core.web.core.controller;

import com.example.demo.core.web.core.model.CommonResult;
import com.example.demo.core.web.core.model.ErrorCode;

/**
 * @author airhead
 */
public class BaseController {
  public CommonResult<Void> success() {
    return CommonResult.success(null);
  }

  public CommonResult<String> success(String msg) {
    return CommonResult.success(msg);
  }

  public <T> CommonResult<T> success(T result) {
    return CommonResult.success(result);
  }

  public CommonResult<Void> failure(ErrorCode errorCode) {
    return CommonResult.error(errorCode);
  }
}
